//
//  RootViewController.h
//  TableViewPull
//
//  Created by Devin Doty on 10/16/09October16.
//  Copyright enormego 2009. All rights reserved.
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//


#import "EGORefreshTableHeaderView.h"
#import "MBProgressHUD.h"
#import "asyncimageview.h"
@class ASIHTTPRequest;
@class GCDiscreetNotificationView;

typedef enum {
    Mode_Type_Attention,
    Mode_Type_RecommendOrNew,
    Mode_Type_CollectList,
    Mode_Type_InfoShow,
    Mode_Type_ShortInfoShow
}Mode_Type;

@interface PBLViewController : UIViewController  <EGORefreshTableHeaderDelegate, UITableViewDelegate, UITableViewDataSource,MBProgressHUDDelegate,UITextFieldDelegate>{
	
    GCDiscreetNotificationView*  _BottomNot;
    
    MBProgressHUD* p_MBHUD;
    
	EGORefreshTableHeaderView *_refreshHeaderView;
	
    ASIHTTPRequest* _PBLRequest;

	BOOL _reloading;
    
    NSInteger  _NowPageIndex;
    NSInteger  _BFPageIndex;
    BOOL   _IsRequesting;
    
    UIScrollView*  _ContentScrollView;
    
    NSMutableArray*  _ContentDicArr;//数据
    NSMutableArray*  _ViewsArr;//试图数据
    
    NSInteger  _LeftH,_RightH;
    
    NSString*  _TempFloderName;
    NSInteger  _FloderIndex;
    
    
    NSString*  m_RquestURL;
    NSString*  _MaxID;
    
    UIImage* _CommentZC;
    UIImage* _CommentFav;
    UIImage* _CommentRedFav;
    UIImage* _CommentPL;
    UIImage* _UserIcon;
    
    Mode_Type   m_NowModeType;
    
    BOOL   _searchStatus;
    
    //搜索部分
    BOOL   _IsSearchRequesting;
    NSMutableArray*  _SearchContentDicArr;//数据
    NSMutableArray*  _SearchViewsArr;//试图数据
    
    NSInteger  _SearchLeftH,_SearchRightH;
    
    NSInteger  _SearchPageIndex;
    NSString*  _SearchKeyWord;
    NSString*  _SearchTempFName;//搜索贴子的缓存
    NSInteger  _SearchFloderIndex;
    BOOL  _SearchFuncationOpen;//是否已经完全展示了搜索结果
    UIView* _SearchView;
    NSString* _SearchTypeStr;
    UIScrollView*  _SearchContentSView;
    NSInteger  _BolgNum,_CollectNum,_UserNum;
    
    NSArray*  _TieZiSearchDic;//贴子的结果
    NSArray*  _CollectSearchDic;//专辑
    NSArray*  _RenErSearchDic;//人儿
    
    UINavigationController* m_SuperNavVC;
//    NSString*   m_ShowUserID;
    UIView* _TopStatusView;
    
    NSString* _CollectUserIDStr;
}
@property(nonatomic,retain) NSString*  m_RquestURL;
@property Mode_Type   m_NowModeType;
@property (assign) UINavigationController* m_SuperNavVC;
//@property (nonatomic,retain) NSString*   m_ShowUserID;
- (void)reloadTableViewDataSource;
- (void)doneLoadingTableViewData;

-(void) showSearchView;
-(void) dissSearchView;

-(void) firstDataGet;
@end
